
% ============================================
% |        WEIGHT ESTIMATION  TOOL           |
% |											 |
% |               EMPENNAGE                  |
% |											 |
% ============================================

function [W_emp] = WET_Torenbeek_Empennage(canard, TypeEngine, n_ult, S_h, S_v, K_h, K_v, V_d, lambda_12h, lambda_12v, K_c, S_c, lambda_12c)

    if TypeEngine == 0
       
        if canard ==0
            
            W_emp = 0.04 * (n_ult * (S_v + S_h)^2)^0.75;
        
        else
            
            W_emp = 0.04 * (n_ult * (S_v + S_h + S_c)^2)^0.75;
        
        end
            
    else
        
        W_h = K_h*S_h*(3.81*(S_h^.2*V_d/(1000*sqrt(cos(lambda_12h*pi/180))^.5))-.287);
        W_v = K_v*S_v*(3.81*(S_v^.2*V_d/(1000*sqrt(cos(lambda_12v*pi/180))^.5))-.287);  
        
        if canard ==0
            
        	W_emp = W_h + W_v;
            
        else
            
            W_c = K_c*S_c*(3.81*(S_c^.2*V_d/(1000*sqrt(cos(lambda_12c*pi/180))^.5))-.287);
            W_emp = W_h + W_v + W_c;
        
        end
    end
end
    